﻿@{
    ViewBag.Title = "User Management";
}
<script language="javascript" src="/Scripts/MiscCommands.js"></script>
<h2>User Details</h2>
<form name="superform" action="/ControlPanel/UpdateUserDetails" method="post">
    <table>
        <tr>
            <td>
                User ID
            </td>
            <td>
                <input type="text" readonly="readonly" value="@ViewBag.User.UserID" />
            </td>
        </tr>
        <tr>
            <td>
                First Name
            </td>
            <td>
                <input type="text" name="FirstName" value="@ViewBag.User.strFirstName" />
            </td>
        </tr>
        <tr>
            <td>Last Name</td>
            <td><input type="text" name="LastName" value="@ViewBag.User.strLastName" /></td>
        </tr>
        <tr>
            <td>
                Email Address
            </td>
            <td>
                <input type="text" name="Email" value="@ViewBag.User.strEmail" />
            </td>
        </tr>
        <tr>
            <td>
                New Password
            </td>
            <td>
                <input type="password" id="p1" name="passone" />
            </td>
        </tr>
        <tr>
            <td>
                Repeat Password
            </td>
            <td>
                <input type="password" id="p2" name="passtwo" />
            </td>
        </tr>
        <tr>
            <td>
                Department
            </td>
            <td>
                <select name="Department">
                    @{
                        foreach( var item in ViewBag.Departments)
                        {
                            if(item.DepartmentID == ViewBag.User.DepartmentID)
                            {
                                ViewBag.MassiveEasterEggs = "SELECTED";
                            }
                            else
                            {
                                ViewBag.MassiveEasterEggs = "";
                            }
                            <option value="@item.DepartmentID" @ViewBag.MassiveEasterEggs>@item.strDepartmentName</option>
                        }
                    }
                </select>
            </td>
        </tr>
        <tr >
            <td>Change</td>
            <td><input type="submit" value="Submit" id="submitID" /></td>
        </tr>
    </table>
</form>
